﻿#region Using Directives

using LayoutManager.Infrastructure;
using LayoutManager.Modules.Views;
using Microsoft.Practices.Composite.Events;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Unity;

#endregion

namespace LayoutManager.Modules
{
    public class ViewsModule : IModule
    {
        private readonly IUnityContainer _Container;

        public ViewsModule(IUnityContainer container)
        {
            _Container = container;
        }

        #region IModule Members

        public void Initialize()
        {
            var eventAggregator = _Container.Resolve<IEventAggregator>();

            _Container.RegisterInstance<IMenuViewModel>(new MenuViewModel(_Container, eventAggregator, new MenuView()));
            _Container.RegisterInstance<IViewA>(new ViewA());
            _Container.RegisterInstance<IViewB>(new ViewB());
            _Container.RegisterInstance<IViewModelC>(new ViewModelC(new ViewC()));
        }

        #endregion
    }
}